package com.liuceng.zen.pojo.form;

import javax.validation.constraints.Min;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Pattern;

import org.hibernate.validator.constraints.Length;
import org.hibernate.validator.constraints.NotBlank;

import com.liuceng.zen.pojo.domain.Member;

import lombok.Data;

@Data
public class ForgetPasswordForm extends BaseForm {
  @NotBlank(message = "请输入账号")
  @Pattern(regexp = Member.LOGINNAME_PATTERN, message = "账号是4到20个汉字、字母、数字、下划线")
  private String loginName;

  @NotNull(message = "请选择安全保护问题")
  @Min(value = 0, message = "请选择安全保护问题")
  private Integer securityQuestion;
  @NotBlank(message = "请输入您的答案")
  @Length(min = 2, max = 20, message = "请输入规范答案")
  private String securityAnswer;
  @NotBlank(message = "请输入新密码")
  @Length(min = Member.PASSWORD_MIN_LENGTH, max = Member.PASSWORD_MAX_LENGTH,
      message = "密码长度需在{min}到{max}之间")
  private String newPassword;

  @NotBlank(message = "请重复输入新密码")
  @Length(min = Member.PASSWORD_MIN_LENGTH, max = Member.PASSWORD_MAX_LENGTH,
      message = "密码长度需在{min}到{max}之间")
  private String confirmNewPassword;

  @NotBlank(message = "请输入验证码")
  @Length(min = Member.VERIFYCODE_LENGTH, max = Member.VERIFYCODE_LENGTH, message = "验证码长度为{min}位")
  private String captcha;
}
